package jhh.service;

import java.io.File;

public class Delete {
     public void deletebyName(String path){
    	 File f=new File(path);
    	// System.out.println(path);
    	 if(f.exists()){
    		 f.delete();
    	 }else{
    		 System.out.println("不存在文件");
    	 }
     }
     public void deleteAll(String path){
    	 File f=new File(path);
    	 String[] list=f.list();
    	 for(int i=0;i<list.length;i++){
    		 String pathname=path+File.separator+list[i];
    		 deletebyName(pathname);
    	 }
     }
}
